﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExpenseTracker.Entity;
using ExpenseTracker.DataAccess;

namespace ExpenseTracker.Controller
{
    public class CategoryController : BaseController
    {
        private CategoryDb _database = null;

        public CategoryController(ExpenseTracker.Entity.Account account)
            : base(account)
        {
            _database = new CategoryDb(account);
        }

        public void CreateTable()
        {
            _database.CreateTable();
        }

        public void InsertCategory(ExpenseTracker.Entity.Category category)
        {
            _database.InsertCategory(category);
        }

        public void UpdateCategory(ExpenseTracker.Entity.Category category)
        {
            _database.UpdateCategory(category);
        }

        public List<Category> GetCategories(TransactionType transactionType)
        {
            return _database.GetCategories(transactionType);
        }

        public Category GetCategory(int categoryID)
        {
            return _database.GetCategory(categoryID);
        }
    }
}
